package com.igeek.boot.mapper;

import com.igeek.boot.entity.Assets;
import com.igeek.boot.entity.Shelves;
import com.igeek.boot.entity.Warehouses;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jwj
 * @since 2023-12-26
 */
@Mapper
public interface WarehousesMapper extends BaseMapper<Warehouses> {

    //查询仓库的所有信息
    @Select("select * from warehouses where warehouseID = #{id}")
    @Results({
            @Result(id=true,column="warehouseID",property="warehouseID"),
            @Result(property = "shelves" , column = "warehouseID",
                    javaType = java.util.List.class,
                    many = @Many(select = "com.igeek.boot.mapper.ShelvesMapper.selectShelvesByWarehouseId"))
    }
    )
    Warehouses findOneDetail(Integer id);





}
